import React from 'react';
import PropTypes from 'prop-types';
import StyleBadge, { Count } from './style';

const Badge = ({
    children,
    show = false,
    count = 0,
    showZero = false,
    ...rest
}) => {

    return (
        <StyleBadge
            variant={children ? "dot" : "default"}
            show={show}
            count={count}
            showZero={showZero}
            {...rest}
        >
            {children || <Count>{count}</Count>}
        </StyleBadge>
    )
}

Badge.propTypes = {
    show: PropTypes.bool,
    count: PropTypes.number,
    showZero: PropTypes.bool,
    children: PropTypes.any,
}

export default Badge
